<?php
header('Content-Type:text/html;charset=utf-8');
require_once('include/config.php');
require_once('include/wp-db.php');
require_once('include/utils.php');

$username=$_POST['username'];
$phone=$_POST['phone'];
$email=$_POST['email'];
$getid=intval($_POST['id']);
$time=time();


if(strlen_utf8($username)>8 || empty($username) || strlen_utf8($username)<2)
{

			$error[]="用户名不正确";
			echo '-11';
			exit;

}
elseif(!preg_match("/^[\x80-\xff_a-zA-Z0-9]+$/",$username)){
	
			$error[]="用户名不正确";

			echo '-11';

			exit;
	
}


//验证手机号码
if(!preg_match("/^((13[0-9])|(15[0-9])|(18[0-9])|(14[0-9]))[0-9]{8}$/i",$phone))
{
			$error[]="手机格式不正确";
			echo '-12';
			exit;
		
}

//验证email
if(!preg_match("/^(?:[a-z\d]+[_\-\+\.]?)*[a-z\d]+@(?:([a-z\d]+\-?)*[a-z\d]+\.)+([a-z]{2,})+$/i",$email))
{
		$error[]="Email格式不正确";
		echo '-13';
		exit;
	
}

	setcookie("username",$username,time()+24*3600); 
	setcookie("phone",$phone,time()+24*3600);   
	setcookie("email",$email,time()+24*3600);   

	echo '999';
	exit;


?>